//
//  WebViewController.m
//  TaurusXi
//
//  Created by xicheng on 15/12/15.
//  Copyright © 2015年 xicheng. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()<UIWebViewDelegate>

@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  self.customNavigationBar.hidden = YES;
  [self setTitleText:self.title];
  
  NSLog(@"url:%@",self.url);
  
  self.url = [[Api shareApiInstance] getHtmlUrlWith:self.url];
  
  UIView *statusBarView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.deviceWidth, kStatusBarHeight)];
  
  statusBarView.backgroundColor =  self.customNavigationBar.backgroundColor;
  [self.view addSubview:statusBarView];
  UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, self.deviceWidth, self.deviceHeight-kStatusBarHeight)];
  NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
  [self.view addSubview: webView];
  webView.delegate = self;
  [webView loadRequest:request];
  
  [self showSimpleProWithDim];
    // Do any additional setup after loading the view.
}


-(void)webViewDidFinishLoad:(UIWebView *)webView{
  [self hideSimpleProWithDelay:0];
  
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
